package com.exsun.ex1077.network

import com.zhangping.fastjetpack.extend.getCacheString
import okhttp3.Interceptor
import okhttp3.Response

/**
 * 描述：
 * 作者：ZhangPing
 * 创建时间：2022/2/23 21:34
 */
class TokenHeader : Interceptor {

    override fun intercept(chain: Interceptor.Chain): Response {
        val newBuilder = chain.request().newBuilder()
        val token = getCacheString("token")
        newBuilder.addHeader("Authorization", token)
        return chain.proceed(newBuilder.build())
    }
}